<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>会员信息</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="../../../../elementUI/index.css">
  <link rel="stylesheet" href="../../../../css/index.css">
</head>

<body>
  <div id="app" class="minWidth">
    <el-form :inline="true" :form="form">
      <el-form-item>
        <el-select v-model="App_ID" clearable placeholder="请选择小程序">
          <el-option v-for="item in options" :key="item.Enterprise_Appid_SerialNumber" :label="item.App_Name"
            :value="item.App_ID">
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="onSerach">查询</el-button>
      </el-form-item>
      <el-form-item>
        <el-button type="success" @click="RelationshipDiagram">关系图</el-button>
      </el-form-item>
    </el-form>

    <el-table :data="tableData" stripe border height="calc(100vh - 140px)" style="width: 100%">
      <el-table-column label="序号" width="50" type="index"></el-table-column>
      <el-table-column label="会员头像" width="125">
        <template v-slot="{row}">
          <el-image style="width: 100px; height: 100px; border-radius: 9px;" fit="cover" :src="row.Image?row.Image:''">
          </el-image>
        </template>
      </el-table-column>
      <el-table-column prop="Nick" label="会员昵称"></el-table-column>
      <el-table-column prop="Member_Name" label="会员姓名"></el-table-column>
      <el-table-column prop="Member_Rights_Name" label="会员等级"></el-table-column>
      <el-table-column prop="Mobile" label="电话"></el-table-column>
      <el-table-column prop="Prepayment_Balance" label="累计充值"></el-table-column>
      <el-table-column prop="Gift_Balance" label="赠送金额"></el-table-column>
      <el-table-column prop="Open_ID" label="消费客户编号"></el-table-column>
      <el-table-column prop="App_Name" label="所属小程序"></el-table-column>
      <el-table-column label="操作" width="230">
        <template slot-scope="scope">
          <el-button :loading="loading" v-if="scope.row.Employee_Authority=='1'&&JSON.parse(sessionStorage.getItem('RoleArr')).some(item=>item=='B0074')" type="warning" size="small"
            @click="showMember(scope.row,0)">取消员工</el-button>
          <!-- <div v-if="JSON.parse(sessionStorage.getItem('RoleArr')).some(item=>item=='B0020')"> -->
            <el-button :loading="loading" v-else type="success" size="small"
            @click="showMember(scope.row,1)">成为员工</el-button>
          <!-- </div> -->
          <!-- <el-button v-if="JSON.parse(sessionStorage.getItem('RoleArr')).some(item=>item=='B0021')" :loading="loading" type="primary" size="small"
            @click="PromotedMembership(scope.row)">晋升会员</el-button> -->
          <el-button v-if="JSON.parse(sessionStorage.getItem('RoleArr')).some(item=>item=='B0021')" :loading="loading" type="primary" size="small"
            @click="showbrowsing(scope.row)">浏览记录</el-button>
        </template>
      </el-table-column>
    </el-table>
    <!--  -->
    <el-pagination background v-show="total > 0" @size-change="handleSizeChange" @current-change="handleCurrentChange"
      :current-page="form.page" :page-sizes="[10,50,100,500,1000]" :page-size="form.limit"
      layout="total, sizes, prev, pager, next, jumper" :total="total">
    </el-pagination>

    <el-dialog @close="CloseBenefits" title="会员等级" :visible.sync="dialogVisible">
      <el-form :model="form">
        <el-form-item label="会员等级" :label-width="formLabelWidth">
          <el-select v-model="Member_Type_SerialNumber" placeholder="请选择会员等级">
            <el-option v-for="item in Benefits" :key="item.Member_Rights_SerialNumber" :label="item.Member_Rights_Name"
              :value="item.Member_Rights_SerialNumber"></el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button :loading="loading" type="primary" @click="UpgradeMembership">确 定</el-button>
      </span>
    </el-dialog>


  </div>
  <script type="text/javascript" src="../../../../js/jquery-3.6.0.min.js"></script>
  <script type="text/javascript" src="../../../../js/jquery.cookie.js"></script>
  <script type="text/javascript" src="../../../../js/vue.min.js"></script>
  <script type="text/javascript" src="../../../../elementUI/index.js"></script>
  <script type="text/javascript" src="../../../../js/utils.js"></script>
  <script type="text/javascript" src="./js/Member.js"></script>
</body>

</html>